package com.huitu.whht.base.core.api.wr.wiu;

import com.huitu.api.rest.AbstractApiResource;
import com.huitu.commons.PageUtils;
import com.huitu.whht.api.core.common.response.ApiResultBuilder;
import com.huitu.whht.api.core.common.annotations.SzyCoreApiResource;
import com.huitu.whht.api.core.common.annotations.SzyCoreApiService;
import com.huitu.whht.api.core.common.response.StatusRespBuilder;

import com.huitu.whht.base.core.api.wr.wiu.entities.WrWiuB;

import com.huitu.whht.base.core.api.wr.wiu.entities.WrWiuBQo;
import com.huitu.whht.base.core.api.wr.wiu.service.IWrWiuBService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

/**
 * 说明: 取用水户基本信息表API,表名称: WR_WIU_B <br/>
 * 日期: 2019-04-15
 * @author LiuCW
 */
@Component
@SzyCoreApiResource
@Path("wr/wiu/b")
public class WrWiuBResource extends AbstractApiResource {

    private static final Logger LOGGER = LoggerFactory.getLogger(WrWiuBResource.class);

    private static final String UUID = "f78c799b-d41b-45c2-bc16-a262dbb1d04b";

    @Override
    public String getUUID() {
        return UUID;
    }

    @Autowired
    @SzyCoreApiService
    IWrWiuBService wrWiuBService;

    /**
     * @api {get} wr/wiu/b/{wiuCd:\\w{9}} [R][G]根据主键查询
     * @apiDescription [G]根据主键查询WR_WIU_B(取用水户基本信息表)数据
     * @apiName (generate)select by primary key
     * @apiGroup WR_WIU_B-取用水户基本信息表
     * @apiVersion 1.0.0
     * @apiSampleRequest wr/wiu/b/000014846
     * @apiParam   {String}         wiuCd              【必须】取用水户代码
     * @apiSuccess {String}         wiuCd              取用水户代码
     * @apiSuccess {String}         wiuNm              取用水户全称
     * @apiSuccess {String}         lrNm               责任人姓名
     * @apiSuccess {String}         tradTp             行业类别
     * @apiSuccess {String}         ecoTp              经济类型
     * @apiSuccess {String}         monG               监控级别
     * @apiSuccess {String}         wiuTp              取水类型
     * @apiSuccess {String}         web                网址
     * @apiSuccess {String}         eMail              邮箱
     * @apiSuccess {String}         addr               地址
     * @apiSuccess {String}         zip                邮编
     * @apiSuccess {String}         tel                办公室电话
     * @apiSuccess {String}         fax                传真号码
     * @apiSuccess {Date}           ts                 时间戳(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccess {String}         nt                 备注
     * @apiSuccess {String}         adlCd              归属行政层级代码
     * @apiSuccess {String}         isHiLev            是否为高耗水行业
     * @apiSuccess {String}         isVimp             是否重点监控取用水户
     * @apiSuccess {String}         lawAtt             取用水户性质
     * @apiSuccess {String}         userTp             取用水户类型
     * @apiSuccess {Double}         yrWu               取水规模
     * @apiSuccess {String}         certSta            办证状态
     * @apiSuccess {String}         runSta             营业状态
     * @apiSuccess {String}         supOrgCd           上级主管单位代码
     * @apiSuccess {String}         isuse              是否启用: 0 停用 1 启用
     * @apiSuccessExample 请求成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "wiuCd": "000014846",
     * "wiuNm": "恩施市莲花池龙井茶厂",
     * "lrNm": null,
     * "tradTp": null,
     * "ecoTp": null,
     * "monG": "9",
     * "wiuTp": null,
     * "web": null,
     * "eMail": null,
     * "addr": "莲花池村",
     * "zip": null,
     * "tel": null,
     * "fax": null,
     * "ts": "2014-07-26 17:17:30.0",
     * "nt": null,
     * "adlCd": "422801",
     * "isHiLev": null,
     * "isVimp": null,
     * "lawAtt": null,
     * "userTp": null,
     * "yrWu": null,
     * "certSta": null,
     * "runSta": null,
     * "supOrgCd": null,
     * "isuse": "1"
     *  }
     * }
     * @apiUse exceptions
     */
    @GET
    @Path("{wiuCd:\\w{9}}")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response selectByPrimaryKey(@PathParam("wiuCd") String wiuCd) {
        LOGGER.info("根据主键查询 取用水户基本信息表,参数 wiuCd:{}", wiuCd);
        return Response.ok(ApiResultBuilder.create(this, wrWiuBService.selectByPrimaryKey(wiuCd))).build();
    }

    /**
     * @api {post} wr/wiu/b/list [R][G]根据条件查询
     * @apiDescription [G]根据条件查询WR_WIU_B(取用水户基本信息表)数据
     * @apiName (generate)select by filter
     * @apiGroup WR_WIU_B-取用水户基本信息表
     * @apiVersion 1.0.0
     * @apiSampleRequest wr/wiu/b/list
     * @apiParam   {List(String)}   wiuCdList          (数组)取用水户代码
     * @apiParam   {String}         wiuCd              取用水户代码
     * @apiParam   {String}         wiuNm              取用水户全称
     * @apiParam   {String}         lrNm               责任人姓名
     * @apiParam   {List(String)}   tradTpList         (数组)行业类别
     * @apiParam   {List(String)}   ecoTpList          (数组)经济类型
     * @apiParam   {List(String)}   monGList           (数组)监控级别
     * @apiParam   {List(String)}   wiuTpList          (数组)取水类型
     * @apiParam   {String}         web                网址
     * @apiParam   {String}         eMail              邮箱
     * @apiParam   {String}         addr               地址
     * @apiParam   {String}         zip                邮编
     * @apiParam   {String}         tel                办公室电话
     * @apiParam   {String}         fax                传真号码
     * @apiParam   {Date}           tsBgTm             (开始时间)时间戳
     * @apiParam   {Date}           tsEdTm             (结束时间)时间戳
     * @apiParam   {String}         nt                 备注
     * @apiParam   {List(String)}   adlCdList          (数组)归属行政层级代码
     * @apiParam   {String}         adlCd              归属行政层级代码
     * @apiParam   {List(String)}   isHiLevList        (数组)是否为高耗水行业
     * @apiParam   {List(String)}   isVimpList         (数组)是否重点监控取用水户
     * @apiParam   {List(String)}   lawAttList         (数组)取用水户性质
     * @apiParam   {List(String)}   userTpList         (数组)取用水户类型
     * @apiParam   {Double}         yrWuMin            (最小)取水规模
     * @apiParam   {Double}         yrWuMax            (最大)取水规模
     * @apiParam   {List(String)}   certStaList        (数组)办证状态
     * @apiParam   {List(String)}   runStaList         (数组)营业状态
     * @apiParam   {List(String)}   supOrgCdList       (数组)上级主管单位代码
     * @apiParam   {String}         supOrgCd           上级主管单位代码
     * @apiParam   {List(String)}   isuseList          (数组)是否启用: 0 停用 1 启用
     * @apiSuccess {String}         wiuCd              取用水户代码
     * @apiSuccess {String}         wiuNm              取用水户全称
     * @apiSuccess {String}         lrNm               责任人姓名
     * @apiSuccess {String}         tradTp             行业类别
     * @apiSuccess {String}         ecoTp              经济类型
     * @apiSuccess {String}         monG               监控级别
     * @apiSuccess {String}         wiuTp              取水类型
     * @apiSuccess {String}         web                网址
     * @apiSuccess {String}         eMail              邮箱
     * @apiSuccess {String}         addr               地址
     * @apiSuccess {String}         zip                邮编
     * @apiSuccess {String}         tel                办公室电话
     * @apiSuccess {String}         fax                传真号码
     * @apiSuccess {Date}           ts                 时间戳
     * @apiSuccess {String}         nt                 备注
     * @apiSuccess {String}         adlCd              归属行政层级代码
     * @apiSuccess {String}         isHiLev            是否为高耗水行业
     * @apiSuccess {String}         isVimp             是否重点监控取用水户
     * @apiSuccess {String}         lawAtt             取用水户性质
     * @apiSuccess {String}         userTp             取用水户类型
     * @apiSuccess {Double}         yrWu               取水规模
     * @apiSuccess {String}         certSta            办证状态
     * @apiSuccess {String}         runSta             营业状态
     * @apiSuccess {String}         supOrgCd           上级主管单位代码
     * @apiSuccess {String}         isuse              是否启用: 0 停用 1 启用
     * @apiSuccessExample 请求成功:
     * HTTP/1.1 200 OK
     * {
     * "result": [{
     * "wiuCd": "000014846",
     * "wiuNm": "恩施市莲花池龙井茶厂",
     * "lrNm": null,
     * "tradTp": null,
     * "ecoTp": null,
     * "monG": "9",
     * "wiuTp": null,
     * "web": null,
     * "eMail": null,
     * "addr": "莲花池村",
     * "zip": null,
     * "tel": null,
     * "fax": null,
     * "ts": "2014-07-26 17:17:30.0",
     * "nt": null,
     * "adlCd": "422801",
     * "isHiLev": null,
     * "isVimp": null,
     * "lawAtt": null,
     * "userTp": null,
     * "yrWu": null,
     * "certSta": null,
     * "runSta": null,
     * "supOrgCd": null,
     * "isuse": "1"
     *  }]
     * }
     *
     * @apiSuccessExample 分页请求:
     * request header: Rang={max=50;size=50;field=TS DESC}
     * HTTP/1.1 200 OK
     * {
     * "result": [{
     * "wiuCd": "000014846",
     * "wiuNm": "恩施市莲花池龙井茶厂",
     * "lrNm": null,
     * "tradTp": null,
     * "ecoTp": null,
     * "monG": "9",
     * "wiuTp": null,
     * "web": null,
     * "eMail": null,
     * "addr": "莲花池村",
     * "zip": null,
     * "tel": null,
     * "fax": null,
     * "ts": "2014-07-26 17:17:30.0",
     * "nt": null,
     * "adlCd": "422801",
     * "isHiLev": null,
     * "isVimp": null,
     * "lawAtt": null,
     * "userTp": null,
     * "yrWu": null,
     * "certSta": null,
     * "runSta": null,
     * "supOrgCd": null,
     * "isuse": "1"
     *  }],
     * "paging": {
     * "count": 3,
     * "total": 120,
     * "finale": false,
     * "index": 1
     * }
     * }
     * @apiUse header_rang
     * @apiUse exceptions
     */
    @POST
    @Path("list")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response selectList(WrWiuBQo filter) {
        PageUtils.startPageFromRang();
        LOGGER.info("根据条件查询 取用水户基本信息表,参数 WrWiuBQo:{}", filter);
        return Response.ok(ApiResultBuilder.create(this, wrWiuBService.selectList(filter))).build();
    }

    /**
     * @api {put} wr/wiu/b [C][G]新增数据
     * @apiPrivate
     * @apiDescription [G]新增WR_WIU_B(取用水户基本信息表)数据
     * @apiName (generate)add data
     * @apiGroup WR_WIU_B-取用水户基本信息表
     * @apiVersion 1.0.0
     * @apiParam   {String}         wiuCd              【必须】取用水户代码
     * @apiParam   {String}         wiuNm              【必须】取用水户全称
     * @apiParam   {String}         lrNm               责任人姓名
     * @apiParam   {String}         tradTp             行业类别
     * @apiParam   {String}         ecoTp              经济类型
     * @apiParam   {String}         monG               监控级别
     * @apiParam   {String}         wiuTp              取水类型
     * @apiParam   {String}         web                网址
     * @apiParam   {String}         eMail              邮箱
     * @apiParam   {String}         addr               地址
     * @apiParam   {String}         zip                邮编
     * @apiParam   {String}         tel                办公室电话
     * @apiParam   {String}         fax                传真号码
     * @apiParam   {Date}           ts                 时间戳(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {String}         nt                 备注
     * @apiParam   {String}         adlCd              归属行政层级代码
     * @apiParam   {String}         isHiLev            是否为高耗水行业
     * @apiParam   {String}         isVimp             是否重点监控取用水户
     * @apiParam   {String}         lawAtt             取用水户性质
     * @apiParam   {String}         userTp             取用水户类型
     * @apiParam   {Double}         yrWu               取水规模
     * @apiParam   {String}         certSta            办证状态
     * @apiParam   {String}         runSta             营业状态
     * @apiParam   {String}         supOrgCd           上级主管单位代码
     * @apiParam   {String}         isuse              是否启用: 0 停用 1 启用
     * @apiSuccess {Integer}        status             1:新增成功;0:新增失败.
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据,通常包含新增数据的主键值
     * @apiSampleRequest wr/wiu/b
     * @apiSuccessExample 新增成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":{
     *   "wiuCd": "000014846"
     *      }
     *   }
     * }
     @apiSuccessExample 新增失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":{
     *   "wiuCd": "000014846"
     *      }
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * {
     * "wiuCd": "000014846",
     * "wiuNm": "恩施市莲花池龙井茶厂",
     * "lrNm": null,
     * "tradTp": null,
     * "ecoTp": null,
     * "monG": "9",
     * "wiuTp": null,
     * "web": null,
     * "eMail": null,
     * "addr": "莲花池村",
     * "zip": null,
     * "tel": null,
     * "fax": null,
     * "ts": "2014-07-26 17:17:30.0",
     * "nt": null,
     * "adlCd": "422801",
     * "isHiLev": null,
     * "isVimp": null,
     * "lawAtt": null,
     * "userTp": null,
     * "yrWu": null,
     * "certSta": null,
     * "runSta": null,
     * "supOrgCd": null,
     * "isuse": "1"
     * }
     * @apiUse exceptions
     */
    @PUT
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response insert(WrWiuB record) {
        LOGGER.info("新增 取用水户基本信息表,参数 WrWiuB:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.insert(wrWiuBService.insertSelective(record),record))).build();
    }

    /**
     * @api {post} wr/wiu/b/insertBatch [C][G]批量新增数据
     * @apiPrivate
     * @apiDescription [G]批量新增WR_WIU_B(取用水户基本信息表)数据
     * @apiName (generate)addBatch data
     * @apiGroup WR_WIU_B-取用水户基本信息表
     * @apiVersion 1.0.0
     * @apiParam   {String}         wiuCd              【必须】取用水户代码
     * @apiParam   {String}         wiuNm              【必须】取用水户全称
     * @apiParam   {String}         lrNm               责任人姓名
     * @apiParam   {String}         tradTp             行业类别
     * @apiParam   {String}         ecoTp              经济类型
     * @apiParam   {String}         monG               监控级别
     * @apiParam   {String}         wiuTp              取水类型
     * @apiParam   {String}         web                网址
     * @apiParam   {String}         eMail              邮箱
     * @apiParam   {String}         addr               地址
     * @apiParam   {String}         zip                邮编
     * @apiParam   {String}         tel                办公室电话
     * @apiParam   {String}         fax                传真号码
     * @apiParam   {Date}           ts                 时间戳(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {String}         nt                 备注
     * @apiParam   {String}         adlCd              归属行政层级代码
     * @apiParam   {String}         isHiLev            是否为高耗水行业
     * @apiParam   {String}         isVimp             是否重点监控取用水户
     * @apiParam   {String}         lawAtt             取用水户性质
     * @apiParam   {String}         userTp             取用水户类型
     * @apiParam   {Double}         yrWu               取水规模
     * @apiParam   {String}         certSta            办证状态
     * @apiParam   {String}         runSta             营业状态
     * @apiParam   {String}         supOrgCd           上级主管单位代码
     * @apiParam   {String}         isuse              是否启用: 0 停用 1 启用
     * @apiSuccess {Integer}        status             1:新增成功;0:新增失败.
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据,通常包含新增数据的主键值
     * @apiSampleRequest wr/wiu/b/insertBatch
     * @apiSuccessExample 新增成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":{
     *   "wiuCd": "000014846"
     *      }
     *   }
     * }
     @apiSuccessExample 新增失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":{
     *   "wiuCd": "000014846"
     *      }
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * [{
     * "wiuCd": "000014846",
     * "wiuNm": "恩施市莲花池龙井茶厂",
     * "lrNm": null,
     * "tradTp": null,
     * "ecoTp": null,
     * "monG": "9",
     * "wiuTp": null,
     * "web": null,
     * "eMail": null,
     * "addr": "莲花池村",
     * "zip": null,
     * "tel": null,
     * "fax": null,
     * "ts": "2014-07-26 17:17:30.0",
     * "nt": null,
     * "adlCd": "422801",
     * "isHiLev": null,
     * "isVimp": null,
     * "lawAtt": null,
     * "userTp": null,
     * "yrWu": null,
     * "certSta": null,
     * "runSta": null,
     * "supOrgCd": null,
     * "isuse": "1"
     * }]
     * @apiUse exceptions
     */
    @POST
    @Path("insertBatch")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response insertBatch(List<WrWiuB> recordList) {
        LOGGER.info("批量新增 取用水户基本信息表,参数 WrWiuB:[]", recordList);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.insert(wrWiuBService.insertBatch(recordList),recordList))).build();
    }

    /**
     * @api {put} wr/wiu/b/{wiuCd:\\w{9}}/update [U][G]根据主键修改
     * @apiPrivate
     * @apiDescription [G]根据主键修改WR_WIU_B(取用水户基本信息表)数据
     * @apiName (generate)update data
     * @apiGroup WR_WIU_B-取用水户基本信息表
     * @apiVersion 1.0.0
     * @apiParam   {String}         wiuCd              【必须】取用水户代码
     * @apiParam   {String}         wiuNm              【必须】取用水户全称
     * @apiParam   {String}         lrNm               责任人姓名
     * @apiParam   {String}         tradTp             行业类别
     * @apiParam   {String}         ecoTp              经济类型
     * @apiParam   {String}         monG               监控级别
     * @apiParam   {String}         wiuTp              取水类型
     * @apiParam   {String}         web                网址
     * @apiParam   {String}         eMail              邮箱
     * @apiParam   {String}         addr               地址
     * @apiParam   {String}         zip                邮编
     * @apiParam   {String}         tel                办公室电话
     * @apiParam   {String}         fax                传真号码
     * @apiParam   {Date}           ts                 【必须】时间戳
     * @apiParam   {String}         nt                 备注
     * @apiParam   {String}         adlCd              归属行政层级代码
     * @apiParam   {String}         isHiLev            是否为高耗水行业
     * @apiParam   {String}         isVimp             是否重点监控取用水户
     * @apiParam   {String}         lawAtt             取用水户性质
     * @apiParam   {String}         userTp             取用水户类型
     * @apiParam   {Double}         yrWu               取水规模
     * @apiParam   {String}         certSta            办证状态
     * @apiParam   {String}         runSta             营业状态
     * @apiParam   {String}         supOrgCd           上级主管单位代码
     * @apiParam   {String}         isuse              是否启用: 0 停用 1 启用
     * @apiSuccess {Integer}        status             1:修改成功;0:要修改的数据不存在(可能已被删除)
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSampleRequest wr/wiu/b/000014846/update
     * @apiSuccessExample 修改成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 修改失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * {
     * "wiuCd": "000014846",
     * "wiuNm": "恩施市莲花池龙井茶厂",
     * "lrNm": null,
     * "tradTp": null,
     * "ecoTp": null,
     * "monG": "9",
     * "wiuTp": null,
     * "web": null,
     * "eMail": null,
     * "addr": "莲花池村",
     * "zip": null,
     * "tel": null,
     * "fax": null,
     * "ts": "2014-07-26 17:17:30.0",
     * "nt": null,
     * "adlCd": "422801",
     * "isHiLev": null,
     * "isVimp": null,
     * "lawAtt": null,
     * "userTp": null,
     * "yrWu": null,
     * "certSta": null,
     * "runSta": null,
     * "supOrgCd": null,
     * "isuse": "1"
     * }
     * @apiUse exceptions
     */
    @PUT
    @Path("{wiuCd:\\w{9}}/update")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response update(@PathParam("wiuCd") String wiuCd, WrWiuB record) {
        record.setWiuCd(wiuCd);
        LOGGER.info("根据主键修改 取用水户基本信息表,参数 WrWiuB:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.update(wrWiuBService.updateByPrimaryKey(record)))).build();
    }

    /**
     * @api {put} wr/wiu/b/{wiuCd:\\w{9}}/update-selective [U][G]根据主键修改(只修改非null字段)
     * @apiPrivate
     * @apiDescription [G]根据主键修改WR_WIU_B(取用水户基本信息表)数据,只修改非null字段
     * @apiName (generate)update selected data
     * @apiGroup WR_WIU_B-取用水户基本信息表
     * @apiVersion 1.0.0
     * @apiParam   {String}         wiuCd              取用水户代码
     * @apiParam   {String}         wiuNm              取用水户全称
     * @apiParam   {String}         lrNm               责任人姓名
     * @apiParam   {String}         tradTp             行业类别
     * @apiParam   {String}         ecoTp              经济类型
     * @apiParam   {String}         monG               监控级别
     * @apiParam   {String}         wiuTp              取水类型
     * @apiParam   {String}         web                网址
     * @apiParam   {String}         eMail              邮箱
     * @apiParam   {String}         addr               地址
     * @apiParam   {String}         zip                邮编
     * @apiParam   {String}         tel                办公室电话
     * @apiParam   {String}         fax                传真号码
     * @apiParam   {Date}           ts                 时间戳
     * @apiParam   {String}         nt                 备注
     * @apiParam   {String}         adlCd              归属行政层级代码
     * @apiParam   {String}         isHiLev            是否为高耗水行业
     * @apiParam   {String}         isVimp             是否重点监控取用水户
     * @apiParam   {String}         lawAtt             取用水户性质
     * @apiParam   {String}         userTp             取用水户类型
     * @apiParam   {Double}         yrWu               取水规模
     * @apiParam   {String}         certSta            办证状态
     * @apiParam   {String}         runSta             营业状态
     * @apiParam   {String}         supOrgCd           上级主管单位代码
     * @apiParam   {String}         isuse              是否启用: 0 停用 1 启用
     * @apiSuccess {Integer}        status             1:修改成功;0:要修改的数据不存在(可能已被删除)
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSampleRequest wr/wiu/b/000014846/update-selective
     * * @apiSuccessExample 修改成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 修改失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * {
     * "wiuCd": "000014846",
     * "wiuNm": "恩施市莲花池龙井茶厂",
     * "lrNm": null,
     * "tradTp": null,
     * "ecoTp": null,
     * "monG": "9",
     * "wiuTp": null,
     * "web": null,
     * "eMail": null,
     * "addr": "莲花池村",
     * "zip": null,
     * "tel": null,
     * "fax": null,
     * "ts": "2014-07-26 17:17:30.0",
     * "nt": null,
     * "adlCd": "422801",
     * "isHiLev": null,
     * "isVimp": null,
     * "lawAtt": null,
     * "userTp": null,
     * "yrWu": null,
     * "certSta": null,
     * "runSta": null,
     * "supOrgCd": null,
     * "isuse": "1"
     * }
     * @apiUse exceptions
     */
    @PUT
    @Path("{wiuCd:\\w{9}}/update-selective")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response updateSelective(@PathParam("wiuCd") String wiuCd, WrWiuB record) {
        record.setWiuCd(wiuCd);
        LOGGER.info("根据主键修改(只修改非null字段) 取用水户基本信息表,参数 WrWiuB:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.update(wrWiuBService.updateByPrimaryKeySelective(record)))).build();
    }

    /**
     * @api {post} wr/wiu/b/updateBatch [U][G]根据主键批量修改(只修改非null字段)
     * @apiPrivate
     * @apiDescription [G]根据批量主键修改WR_WIU_B(取用水户基本信息表)数据,只修改非null字段
     * @apiName (generate)updateBatch selected data
     * @apiGroup WR_WIU_B-取用水户基本信息表
     * @apiVersion 1.0.0
     * @apiParam   {String}         wiuCd              取用水户代码
     * @apiParam   {String}         wiuNm              取用水户全称
     * @apiParam   {String}         lrNm               责任人姓名
     * @apiParam   {String}         tradTp             行业类别
     * @apiParam   {String}         ecoTp              经济类型
     * @apiParam   {String}         monG               监控级别
     * @apiParam   {String}         wiuTp              取水类型
     * @apiParam   {String}         web                网址
     * @apiParam   {String}         eMail              邮箱
     * @apiParam   {String}         addr               地址
     * @apiParam   {String}         zip                邮编
     * @apiParam   {String}         tel                办公室电话
     * @apiParam   {String}         fax                传真号码
     * @apiParam   {Date}           ts                 时间戳
     * @apiParam   {String}         nt                 备注
     * @apiParam   {String}         adlCd              归属行政层级代码
     * @apiParam   {String}         isHiLev            是否为高耗水行业
     * @apiParam   {String}         isVimp             是否重点监控取用水户
     * @apiParam   {String}         lawAtt             取用水户性质
     * @apiParam   {String}         userTp             取用水户类型
     * @apiParam   {Double}         yrWu               取水规模
     * @apiParam   {String}         certSta            办证状态
     * @apiParam   {String}         runSta             营业状态
     * @apiParam   {String}         supOrgCd           上级主管单位代码
     * @apiParam   {String}         isuse              是否启用: 0 停用 1 启用
     * @apiSuccess {Integer}        status             1:修改成功;0:要修改的数据不存在(可能已被删除)
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSampleRequest  wr/wiu/b/updateBatch
     * * @apiSuccessExample 修改成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 修改失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * [{
     * "wiuCd": "000014846",
     * "wiuNm": "恩施市莲花池龙井茶厂",
     * "lrNm": null,
     * "tradTp": null,
     * "ecoTp": null,
     * "monG": "9",
     * "wiuTp": null,
     * "web": null,
     * "eMail": null,
     * "addr": "莲花池村",
     * "zip": null,
     * "tel": null,
     * "fax": null,
     * "ts": "2014-07-26 17:17:30.0",
     * "nt": null,
     * "adlCd": "422801",
     * "isHiLev": null,
     * "isVimp": null,
     * "lawAtt": null,
     * "userTp": null,
     * "yrWu": null,
     * "certSta": null,
     * "runSta": null,
     * "supOrgCd": null,
     * "isuse": "1"
     * }]
     * @apiUse exceptions
     */
    @POST
    @Path("updateBatch")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response updateBatch(List<WrWiuB> record) {
        LOGGER.info("根据主键批量修改(只修改非null字段) 取用水户基本信息表,参数 WrWiuB:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.update(wrWiuBService.updateBatch(record)))).build();
    }

    /**
     * @api {delete} wr/wiu/b/{wiuCd:\\w{9}} [D][G]根据主键删除
     * @apiPrivate
     * @apiDescription [G]根据主键删除WR_WIU_B(取用水户基本信息表)数据
     * @apiName (generate)delete by primary key
     * @apiGroup WR_WIU_B-取用水户基本信息表
     * @apiVersion 1.0.0
     * @apiSampleRequest wr/wiu/b/000014846
     * @apiParam   {String}         wiuCd              【必须】取用水户代码
     * @apiSuccess {Integer}        status             1:删除成功;0:要删除的数据不存在(可能已被删除).
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSuccessExample 删除成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 删除失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiUse exceptions
     */
    @DELETE
    @Path("{wiuCd:\\w{9}}")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response delete(@PathParam("wiuCd") String wiuCd) {
        LOGGER.info("根据主键删除 取用水户基本信息表,参数 wiuCd:{}", wiuCd);
        Integer rows = wrWiuBService.deleteByPrimaryKey(wiuCd);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.delete(rows))).build();
    }

    /**
     * @api {delete} wr/wiu/b/by-filter [D][G]根据条件删除
     * @apiPrivate
     * @apiDescription [G]根据条件删除WR_WIU_B(取用水户基本信息表)数据
     * @apiName (generate)delete by filter
     * @apiGroup WR_WIU_B-取用水户基本信息表
     * @apiVersion 1.0.0
     * @apiSampleRequest wr/wiu/b/by-filter
     * @apiParam   {List(String)}   wiuCdList          (数组)取用水户代码
     * @apiParam   {String}         wiuCd              取用水户代码
     * @apiParam   {String}         wiuNm              取用水户全称
     * @apiParam   {String}         lrNm               责任人姓名
     * @apiParam   {List(String)}   tradTpList         (数组)行业类别
     * @apiParam   {List(String)}   ecoTpList          (数组)经济类型
     * @apiParam   {List(String)}   monGList           (数组)监控级别
     * @apiParam   {List(String)}   wiuTpList          (数组)取水类型
     * @apiParam   {String}         web                网址
     * @apiParam   {String}         eMail              邮箱
     * @apiParam   {String}         addr               地址
     * @apiParam   {String}         zip                邮编
     * @apiParam   {String}         tel                办公室电话
     * @apiParam   {String}         fax                传真号码
     * @apiParam   {Date}           tsBgTm             (开始时间)时间戳
     * @apiParam   {Date}           tsEdTm             (结束时间)时间戳
     * @apiParam   {String}         nt                 备注
     * @apiParam   {List(String)}   adlCdList          (数组)归属行政层级代码
     * @apiParam   {String}         adlCd              归属行政层级代码
     * @apiParam   {List(String)}   isHiLevList        (数组)是否为高耗水行业
     * @apiParam   {List(String)}   isVimpList         (数组)是否重点监控取用水户
     * @apiParam   {List(String)}   lawAttList         (数组)取用水户性质
     * @apiParam   {List(String)}   userTpList         (数组)取用水户类型
     * @apiParam   {Double}         yrWuMin            (最小)取水规模
     * @apiParam   {Double}         yrWuMax            (最大)取水规模
     * @apiParam   {List(String)}   certStaList        (数组)办证状态
     * @apiParam   {List(String)}   runStaList         (数组)营业状态
     * @apiParam   {List(String)}   supOrgCdList       (数组)上级主管单位代码
     * @apiParam   {String}         supOrgCd           上级主管单位代码
     * @apiParam   {List(String)}   isuseList          (数组)是否启用: 0 停用 1 启用
     * @apiSuccess {Integer}        status             通常1或者>1:删除成功;0:没有符合条件的数据.
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSuccessExample 删除成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 删除失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiUse exceptions
     */
    @DELETE
    @Path("by-filter")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response deleteByFilter(WrWiuBQo filter) {
        LOGGER.info("根据条件删除 取用水户基本信息表,参数 WrWiuBQo:{}", filter);
        Integer rows = wrWiuBService.deleteByFilter(filter);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.delete(rows))).build();
    }
}
